package wangxiaotao.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.stereotype.Component;
import wangxiaotao.task.ScheduledTask;

@Component
@EnableCaching
public class StartInitTask implements CommandLineRunner {
    @Autowired
    private ScheduledTask scheduledTask;

    /**
     * 启动加载的定时任务
     * @param args
     * @throws Exception
     */
    @Override
    public void run(String... args) throws Exception {
//        List<TaskEntity> list = Collections.singletonList(
//                new TaskEntity(1, "测试1", "0/1 * * * * ?")
//        );
//        scheduledTask.refresh(list);
    }
}
